<%@page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>风险管理平台</title>
<link href="DWZ/themes/css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="DWZ/js/des.js"></script>
<script src="DWZ/js/jquery-2.1.4.js" type="text/javascript"></script>

 <script language="javascript" type="text/javascript">
function changeImg(){
	var img = document.getElementById("yzm");
	img.src = "captcha.do";
}
function login(){
	var lct = document.location;
	var baseUrl = [lct.protocol, "//", lct.host].join("")+"<%=request.getContextPath()%>"+"/";
	
	var ucode = $("#ucode").val();
	var ocode = $("#ocode").val();
	var pwd = $("#pwd").val();
	var code = $("#code").val();
	
	var params={"ucode":strEnc(ucode,"key"),"ocode":strEnc(ocode,"key"),"pwd":strEnc(pwd,"key"),"code":strEnc(code,"key")};
	
	$.ajax({
		type:"post",
		dateType:"html",
		url:baseUrl+"login.do",
		data:params,
		success:function(data){
			data=data.replace(/&#(\d+);/gm,function(){return String.fromCharCode(arguments[1]);});
        	try{eval(" var ret="+data );}catch(e){};
        	if(ret && ret.statusCode=="200"){
        		top.location=baseUrl+"index.jsp";
        	}else{
        		$("#btnlogin").removeAttr("disabled");
            	if(ret && (ret.rcode=="101" || ret.rcode=="102" || ret.rcode=="103")){
            		changeImg();
            		document.forms[0].j_yzm.value="";
            		document.forms[0].j_yzm.focus();
                }
        		alert(ret.message);
        		return;
        	}
		},
		error:function(data){
			$("#btnlogin").removeAttr("disabled");
        	alert("登录失败！");
        	return false;
		}
		
	});
}
</script>
</head>

<body>
	<div id="login">
		<div id="login_header">
			<h1 class="login_logo">
				<a href="http://demo.dwzjs.com"><img src="DWZ/themes/default/images/login_logo.gif" /></a>
			</h1>
			<div class="login_headerContent">
				<div class="navList">
					<ul>
						<li><a href="#">设为首页</a></li>
						<li><a href="http://bbs.dwzjs.com">反馈</a></li>
						<li><a href="doc/dwz-user-guide.pdf" target="_blank">帮助</a></li>
					</ul>
				</div>
				<h2 class="login_title"><img src="DWZ/themes/default/images/login_title.png" /></h2>
			</div>
		</div>
		<div id="login_content">
			<div class="loginForm">
				
				<form>
					<p>
						<label>机构编码</label>
						<input type="text" id="ocode" size="20" class="login_input" />
					</p>
					<p>
						<label>用编码：</label>
						<input type="text" id="ucode" size="20" class="login_input" />
					</p>
					<p>
						<label>密码：</label>
						<input type="password" id="pwd" size="20" class="login_input" />
					</p>
					<p>
						<label>验证码：</label>
						<input name="code" id="code"  class="code" type="text" size="5" maxlength="5" title="请输入图中的验证码"/>
					 	<span>
					 		<img id="yzm" src="captcha.do" border=0 width="75" height="24" title="看不清，请点击" style="cursor:pointer;" />
					 	</span>  
						
					</p>
					<div class="login_bar">
						<input class="sub" id="btnlogin" type="button" value="" onclick="login()"/>
					</div>
				</form>
			</div>
			<div class=""><img src="DWZ/themes/default/images/login_banner.jpg" /></div>
			<div class="login_main">
				<ul class="helpList">
					
				</ul>
			</div>
		</div>
		<div id="login_footer">
			Copyright &copy; 2009 www.dwzjs.com Inc. All Rights Reserved.
		</div>
	</div>
</body>
</html>